package edu.washington.ling.syntric.io;

import java.io.IOException;

public abstract class ExampleDocWriter {

	private String path;
	public final String[] allLayers = new String[]{"PS", "DS-Const", "DS+PB", "DS", "PB"};
			
	public ExampleDocWriter(String path) throws IOException {
		this.path = path;
	}
	
	public static ExampleDocWriter newWriter(String path, String format) throws IOException {
		ExampleDocWriter exfw;
		if (format.equals("sgml"))
			exfw = new ExampleDocWriterSGML(path);
		else if (format.equals("xml"))
			exfw = new ExampleDocWriterXML(path);
		else if (format.equals("latex"))
			exfw = new ExampleDocWriterLaTeX(path);
		else
			exfw = null;
		return exfw;
	}
	public String getPath() {
		return path;
	}
	public abstract void close();
	public abstract void writeExample(Example exr);
	public abstract void writeExample(Example exr, String[] includeLayers);
}
